package obecto.transition
{
	import obecto.event.TaskEvent;
	import obecto.task.ITask;
	import obecto.task.wrapper.TaskWrapper;
	
	public class Transition extends TaskWrapper implements ITransition
	{
		[Bindable] 
		public var fromState : Object;
		[Bindable] 
		public var toState : Object;
		
		[Bindable]
		public var interruptionPolicy : TransitionInterruptionPolicy;
		
		[Bindable]
		public var autoReverse : Boolean = false;
		
		[Bindable]
		public var transitingFrom : State;
		[Bindable]
		public var transitingTo : State;

		public function Transition(task : ITask = null)
		{
			super(task);
		}
		
		override public function interrupt() : void
		{
			super.interrupt();
			
			transitingFrom = transitingTo = null;
		}
		
		override protected function handleWrappedTaskComplete(event : TaskEvent) : void
		{
			super.handleWrappedTaskComplete(event);
			
			transitingFrom = transitingTo = null;
		}
	}
}